package com.shihang.crm.web.interceptor;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.MethodFilterInterceptor;
import com.shihang.crm.bean.User;

import java.util.Map;

public class PrivilegeInterceptor extends MethodFilterInterceptor {
    @Override
    protected String doIntercept(ActionInvocation actionInvocation) throws Exception {
        Map<String,Object> session = ActionContext.getContext().getSession();
        User user = (User) session.get("user");
        //if(user!=null){
            return actionInvocation.invoke();
        //}
        //return "toLogin";
    }
}
